package com.nbcb.fund.service.impl;

import com.nbcb.fund.dao.MyFundDao;
import com.nbcb.fund.entity.po.MyFundKeyPo;
import com.nbcb.fund.service.MyFundKeyService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class MyFundKeyServiceImpl implements MyFundKeyService {

    @Resource
    MyFundDao myFundDao;

    @Override
    public List<MyFundKeyPo> selectByUserId(String userId) {
        List<MyFundKeyPo> myFundKeyPoList = myFundDao.selectByUserId(userId);
        return myFundKeyPoList;
    }

    @Override
    public int addMyFund(MyFundKeyPo myFundKeyPo) {
        return myFundDao.insertSelective(myFundKeyPo);
    }

    @Override
    public int deleteMyFund(MyFundKeyPo myFundKeyPo) {
        return myFundDao.deleteByWindCodeAndUserId(myFundKeyPo);
    }

    @Override
    public MyFundKeyPo selectByUserIdAndFundCode(MyFundKeyPo myFundKeyPo) {
        return myFundDao.selectByUserIdAndFundCode(myFundKeyPo);
    }
}